|
| Contents | |
| Introduction |
Music Object patches are quite similar to Music Object extensions in that they are presented as optional add-on modules of JavaScript code that build upon the core Music Object API. Unlike extensions, however, patches do not add new features or capabilities to the API, but are intended to work around certain problems that may arise from browser compatibility issues or changes that occur between different versions of the Music Object API.
For example, Music Object Patch - Pre 3.3.0 is designed to help authors transition from Music Object version 3.2.x to version 3.3.0 without having to change any sonification scripting, even though changes were made to the API between version 3.2.x and version 3.3.0.
Using the Music Object patches is easy. Patches are simply JavaScript files like the "music-object.js" file that can be sourced into sonified pages as needed. In the following example, Music Object Patch - Pre 3.3.0 is being used...
<HTML><TITLE>Page Using Music Object Patch</TITLE></HTML>
<BODY>
<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT SRC="music-object-p-pre330.js"></SCRIPT>
<SCRIPT LANGUAGE=JavaScript><!-- //
// ***************************
// SOME SONIFICATION SCRIPTING
// ***************************
// --></SCRIPT>
<!-- ****************** -->
<!-- SOME SONIFIED HTML -->
<!-- ****************** -->
</BODY></HTML>
|
With the majority of patches, it doesn't matter in which order you source in the patches, as long as they are all sourced in following the "music-object.js" file, and not before it. If you source in a patch file before sourcing in "music-object.js", the patch simply will not work. This would be similar to trying to use a JavaScript function before you have defined it. In order to add a patch to Music Object, Music Object must first be defined.
In most cases, patches have been designed to be independent of other patches or extensions. However, there may be some exceptions to this rule, as it is possible that a patch may require some of the features of another patch or extension in order to function correctly. To be 100% certain of the order in which patches and extensions should be sourced in, consult the documentation for individual patches to find out what their dependencies are. As a simple rule, if a patch depends on another patch or extension, then that required patch or extension should be sourced in before the patch that depends on it.
| What Patches are Available? |
The Music Object patches listed below are released and fully documented.
| Building Patches Into a Suite |
If you find yourself regularly using a particular patch (or group of patches) in all your sonified Web pages, then you may wish to consider building a Music Object suite to simplify your authoring and to make your life a little easier. For more information, consult the section Making a Custom Music Object Suite